package com.patterns.design.security.web.struts.common;

import org.apache.struts.action.ActionForm;

/**
 * Defined basic validation behaviors.
 *
 */
public abstract class BaseForm extends ActionForm{
	/**
	 * No javascript is allowed in the request attribute 
	 */
	protected boolean sanitizeNoJavascript;
	/**
	 * Security is based on Attribute Type 
	 */
	protected boolean validateForHtml;
	/**
	 * Security is based on Attribute Type 
	 */
	protected boolean validateBaseOnSufixInFilter;
	/**
	 * Security is based on Attribute Type 
	 */
	protected boolean validateBaseOnSufixInForm;
	/**
	 * Encode response elements  
	 */
	protected boolean encodeForHtmlInFilter;
	/**
	 * Encode request elements. 
	 */
	protected boolean encodeForHtmlInAction;
	
	public boolean isSanitizeNoJavascript() {
		return sanitizeNoJavascript;
	}
	public void setSanitizeNoJavascript(boolean sanitizeNoJavascript) {
		this.sanitizeNoJavascript = sanitizeNoJavascript;
	}
	public boolean isValidateForHtml() {
		return validateForHtml;
	}
	public void setValidateForHtml(boolean validateForHtml) {
		this.validateForHtml = validateForHtml;
	}
	public boolean isValidateBaseOnSufixInFilter() {
		return validateBaseOnSufixInFilter;
	}
	public void setValidateBaseOnSufixInFilter(boolean validateBaseOnSufixInFilter) {
		this.validateBaseOnSufixInFilter = validateBaseOnSufixInFilter;
	}
	public boolean isEncodeForHtmlInFilter() {
		return encodeForHtmlInFilter;
	}
	public void setEncodeForHtmlInFilter(boolean encodeForHtmlInFilter) {
		this.encodeForHtmlInFilter = encodeForHtmlInFilter;
	}
	public boolean isEncodeForHtmlInAction() {
		return encodeForHtmlInAction;
	}
	public void setEncodeForHtmlInAction(boolean encodeForHtmlInAction) {
		this.encodeForHtmlInAction = encodeForHtmlInAction;
	}
	public boolean isValidateBaseOnSufixInForm() {
		return validateBaseOnSufixInForm;
	}
	public void setValidateBaseOnSufixInForm(boolean validateBaseOnSufixInForm) {
		this.validateBaseOnSufixInForm = validateBaseOnSufixInForm;
	}
	
}
